#ifndef __GAMEMACROS_H__
#define __GAMEMACROS_H__


#define STATIC_SCENE(__TYPE__)\
static CCScene* scene()\
{\
	CCScene *pScene = CCScene::create();\
	pScene->addChild(__TYPE__::create());\
	return pScene;\
}

//#define  STATIC_SCENE_WITH_PARAM(__TYPE__, __INT__)\
//	static CCScene* scene(int param)\
//{\
//	CCScene *pScene = CCScene::create();\
//	pScene->addChild(__TYPE__::create(__INT__));\
//	return pScene;\
//}
//
//#define CREATE_FUNC_WITH_PARAM(__TYPE__, __INT__) \
//	static __TYPE__* create() \
//{ \
//	__TYPE__ *pRet = new __TYPE__(__INT__); \
//	if (pRet && pRet->init()) \
//	{ \
//	pRet->autorelease(); \
//	return pRet; \
//	} \
//	else \
//	{ \
//	delete pRet; \
//	pRet = NULL; \
//	return NULL; \
//	} \
//}

#define REPLACE_SCENE(_TRANSITIONSCENE_, _DURATION_, _INSCENE_)\
_TRANSITIONSCENE_ *pScene = _TRANSITIONSCENE_::create(_DURATION_, _INSCENE_::scene());\
CCDirector::sharedDirector()->replaceScene(pScene);


#define FIX_POS(_pos, _min, _max) \
	if (_pos < _min)        \
	_pos = _min;        \
else if (_pos > _max)   \
	_pos = _max;        \

#endif

